import store from '@/store';
import { defineStore } from 'pinia';

export const useAppStore: any = defineStore(
  'app',
  () => {
    const mainLoading = ref(false);
    const clearCache = () => {
      mainLoading.value = false;
    };

    return {
      mainLoading: mainLoading,
      clearCache: clearCache
    };
  }
);

// 在组件setup函数外使用
export function appStoreOutside() {
  return useAppStore(store);
}
